(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/boxDetail/index" ], {
    1749: function(t, n, e) {
        e.d(n, "b", function() {
            return o;
        }), e.d(n, "c", function() {
            return u;
        }), e.d(n, "a", function() {
            return i;
        });
        var i = {
            TextNavBar: function() {
                return e.e("components/TextNavBar/TextNavBar").then(e.bind(null, "24d6"));
            },
            CountDown: function() {
                return e.e("components/CountDown/CountDown").then(e.bind(null, "cdfb"));
            },
            uniPopup: function() {
                return e.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(e.bind(null, "50c2"));
            },
            BoxSkuPopup: function() {
                return e.e("components/BoxSkuPopup/BoxSkuPopup").then(e.bind(null, "16ac"));
            },
            SharePopup: function() {
                return Promise.all([ e.e("common/vendor"), e.e("components/SharePopup/SharePopup") ]).then(e.bind(null, "4b48"));
            },
            HiddenSkuRank: function() {
                return e.e("components/HiddenSkuRank/HiddenSkuRank").then(e.bind(null, "5ada"));
            },
            Danmus: function() {
                return e.e("components/Danmus/Danmus").then(e.bind(null, "7d24"));
            }
        }, o = function() {
            var t = this, n = (t.$createElement, t._self._c, t.isInit && t.info.is_presell && 0 !== t.info.presell_mode && 1 === t.info.presell_mode ? t.$tool.formatDate(t.info.presell_date, "yyyy-MM-dd") : null);
            t._isMounted || (t.e0 = function(n) {
                t.isSharePopup = !0;
            }, t.e1 = function(n) {
                t.isShowHiddenSkuRank = !0;
            }, t.e2 = function(n) {
                return t.$refs.detailPopup.close();
            }, t.e3 = function(n) {
                t.isSharePopup = !1;
            }, t.e4 = function(n) {
                t.isShowHiddenSkuRank = !1;
            }), t.$mp.data = Object.assign({}, {
                $root: {
                    g0: n
                }
            });
        }, u = [];
    },
    "278d": function(t, n, e) {},
    "470c": function(t, n, e) {
        e.r(n);
        var i = e("4895"), o = e.n(i);
        for (var u in i) "default" !== u && function(t) {
            e.d(n, t, function() {
                return i[t];
            });
        }(u);
        n.default = o.a;
    },
    4895: function(t, n, e) {
        (function(t) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var i = function(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }(e("a34a"));
            function o(t, n, e, i, o, u, r) {
                try {
                    var a = t[u](r), s = a.value;
                } catch (t) {
                    return void e(t);
                }
                a.done ? n(s) : Promise.resolve(s).then(i, o);
            }
            function u(t, n) {
                var e = Object.keys(t);
                if (Object.getOwnPropertySymbols) {
                    var i = Object.getOwnPropertySymbols(t);
                    n && (i = i.filter(function(n) {
                        return Object.getOwnPropertyDescriptor(t, n).enumerable;
                    })), e.push.apply(e, i);
                }
                return e;
            }
            function r(t) {
                for (var n = 1; n < arguments.length; n++) {
                    var e = null != arguments[n] ? arguments[n] : {};
                    n % 2 ? u(Object(e), !0).forEach(function(n) {
                        a(t, n, e[n]);
                    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : u(Object(e)).forEach(function(n) {
                        Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(e, n));
                    });
                }
                return t;
            }
            function a(t, n, e) {
                return n in t ? Object.defineProperty(t, n, {
                    value: e,
                    enumerable: !0,
                    configurable: !0,
                    writable: !0
                }) : t[n] = e, t;
            }
            var s = {
                components: {
                    BoxThmemDefault: function() {
                        e.e("pages/boxDetail/boxTheme/Default").then(function() {
                            return resolve(e("5f3c"));
                        }.bind(null, e)).catch(e.oe);
                    },
                    BoxTheme3D: function() {
                        e.e("pages/boxDetail/boxTheme/Box3D").then(function() {
                            return resolve(e("3aec"));
                        }.bind(null, e)).catch(e.oe);
                    }
                },
                data: function() {
                    return {
                        loading: !0,
                        test: !1,
                        uuid: "",
                        info: {},
                        number: 12,
                        contentHeight: 4e3,
                        deepColor: !1,
                        startMoving: !1,
                        userlist: [],
                        deviceHeight: this.$device.screenHeight,
                        viewType: "3d",
                        isSharePopup: !1,
                        isShowHiddenSkuRank: !1,
                        isShowDetail: !1,
                        isInit: !1,
                        danmuList: [],
                        danmuSetting: {},
                        skuList: [],
                        skuListSetting: {}
                    };
                },
                computed: r(r({}, (0, e("26cb").mapGetters)([ "userInfo", "token" ])), {}, {
                    config: function() {
                        return this.$store.getters.setting.box_room || {};
                    },
                    contentStyle: function() {
                        return "min-height:".concat(this.contentHeight, "px;background-color: ").concat(this.info.bg_color, ";");
                    },
                    room: function() {
                        return this.info.room || {};
                    },
                    avatar: function() {
                        return this.token ? this.userInfo.headimg : "/static/toux.png";
                    },
                    share: function() {
                        return {
                            title: this.info.title,
                            thumb: this.info.thumb,
                            desc: "",
                            path: "/pages/boxDetail/index?uuid=" + this.info.uuid + "&invite_node=box-" + this.info.uuid
                        };
                    },
                    posterInfo: function() {
                        var t = this.getShareConfig(!1);
                        return {
                            money_price: this.info.money_price,
                            score_price: this.info.score_price,
                            title: this.info.title,
                            path: t.path,
                            app_url: t.app_url,
                            thumb: this.info.thumb
                        };
                    },
                    bgImage: function() {
                        return this.isInit ? this.info.room_bg_image || this.config.bg_image || "https://cdn2.hquesoft.com/box/bg.png" : "";
                    },
                    isDarkMode: function() {
                        return 2 === this.info.bg_color_mode;
                    },
                    tips: function() {
                        return this.info.tips || "官方正品，非质量问题不支持退换";
                    },
                    isThemeChangeable: function() {
                        return 1 === this.info.theme_mode || 2 === this.info.theme_mode;
                    }
                }),
                onLoad: function(n) {
                    var e = this;
                    this.test = !!n.test, this.uuid = n.uuid, t.getSystemInfo({
                        success: function(t) {
                            e.contentHeight = t.windowHeight;
                        }
                    }), t.showLoading({
                        title: "加载中",
                        mask: !0
                    }), this.$http("/boxes/" + n.uuid).then(function(n) {
                        e.isInit = !0, e.loading = !1, t.hideLoading();
                        var i = n.data.info;
                        e.info = i, t.setNavigationBarTitle({
                            title: e.info.title
                        }), 2 !== e.info.theme_mode && 4 !== e.info.theme_mode || (e.viewType = "default"), 
                        e.$visitor.record({
                            type: "box_detail",
                            title: e.info.title
                        }), e.$http("/boxes/".concat(e.uuid, "/skus")).then(function(t) {
                            e.skuList = t.data.list;
                        }), e.getDanmu();
                    }).catch(function(n) {
                        t.hideLoading();
                    }), this.config.bgm && this.$playBgm(this.config.bgm);
                },
                watch: {
                    config: function() {
                        this.config.bgm && this.$playBgm(this.config.bgm);
                    }
                },
                onUnload: function() {
                    this.$stopBgm();
                },
                onShow: function() {
                    var t = this;
                    this.info.uuid && this.$http("/boxes/" + this.info.uuid, "GET", {
                        room_id: this.room.id
                    }).then(function(n) {
                        var e = n.data.info;
                        t.info = e;
                    }), this.$http("/setting/box").then(function(n) {
                        t.skuListSetting = n.data.setting;
                    });
                },
                methods: {
                    goLotteryDetail: function() {
                        t.navigateTo({
                            url: "/pages/lottery/detail?uuid=" + this.info.lottery.uuid
                        });
                    },
                    goJikaDetail: function() {
                        t.navigateTo({
                            url: "/pages/jika/detail?uuid=" + this.info.jika.uuid
                        });
                    },
                    buyMany: function(n) {
                        if (this.info.is_presell && 0 === this.info.presell_mode) return t.showToast({
                            title: "此款正在预售中，暂不可购买哦~",
                            icon: "none"
                        }), !1;
                        var e = this.room.sku_status.findIndex(function(t) {
                            return 0 === t;
                        });
                        if (-1 == e) return t.showToast({
                            title: "此盒已售完，换一盒吧~",
                            icon: "none"
                        }), !1;
                        t.navigateTo({
                            url: "/pages/openBox/index?index=".concat(e + 1, "&roomUuid=").concat(this.room.uuid, "&uuid=").concat(this.info.uuid, "&buyMode=").concat(n)
                        });
                    },
                    buyWholeRoom: function() {
                        var n = this;
                        if (this.info.is_presell && 0 === this.info.presell_mode) return t.showToast({
                            title: "此款正在预售中，暂不可购买哦~",
                            icon: "none"
                        }), !1;
                        this.$http("/user").then(function(e) {
                            t.navigateTo({
                                url: "/pages/openBox/index?index=".concat(2, "&roomUuid=").concat(n.room.uuid, "&uuid=").concat(n.info.uuid, "&buyMode=wholeRoom")
                            });
                        });
                    },
                    getDanmu: function() {
                        var t = this;
                        this.$http("/danmus/box_detail?node_id=".concat(this.info.id)).then(function(n) {
                            t.danmuSetting = n.data.setting, t.danmuList = n.data.list;
                        });
                    },
                    changeView: function() {
                        "default" == this.viewType ? this.viewType = "3d" : "3d" == this.viewType && (this.viewType = "default");
                    },
                    refresh: function(n) {
                        var e = this;
                        return function(t) {
                            return function() {
                                var n = this, e = arguments;
                                return new Promise(function(i, u) {
                                    var r = t.apply(n, e);
                                    function a(t) {
                                        o(r, i, u, a, s, "next", t);
                                    }
                                    function s(t) {
                                        o(r, i, u, a, s, "throw", t);
                                    }
                                    a(void 0);
                                });
                            };
                        }(i.default.mark(function n() {
                            var o;
                            return i.default.wrap(function(n) {
                                for (;;) switch (n.prev = n.next) {
                                  case 0:
                                    return t.showLoading({}), n.next = 3, getBoxInfo(e.info.uuid);

                                  case 3:
                                    o = n.sent, e.info = o.data.info, t.hideLoading();

                                  case 6:
                                  case "end":
                                    return n.stop();
                                }
                            }, n);
                        }))();
                    },
                    handleSelect: function(n) {
                        this.test ? t.navigateTo({
                            url: "/pages/testOpenBox/index?index=".concat(n + 1, "&roomUuid=").concat(this.room.uuid, "&uuid=").concat(this.info.uuid)
                        }) : t.navigateTo({
                            url: "/pages/openBox/index?index=".concat(n + 1, "&roomUuid=").concat(this.room.uuid, "&uuid=").concat(this.info.uuid)
                        });
                    },
                    hideImages: function() {
                        this.visible = !1;
                    },
                    showImages: function() {
                        this.$refs.detailPopup.open("bottom");
                    },
                    exchangeNumber: function() {
                        var n = this;
                        t.showLoading({
                            title: "加载中",
                            mask: !0
                        }), this.startMoving = !0, setTimeout(function() {
                            n.startMoving = !1;
                        }, 400), setTimeout(function() {
                            n.$http("/boxes/".concat(n.info.uuid, "/next-room"), "GET", {
                                uuid: n.info.uuid,
                                current_room_id: n.room.id
                            }).then(function(e) {
                                t.hideLoading(), n.info.room = e.data.room;
                            }).catch(function(n) {
                                console.log(n), t.hideLoading();
                            });
                        }, 200);
                    },
                    colorRgb: function(t) {
                        var n = t.toLowerCase();
                        if (4 === n.length) {
                            for (var e = "#", i = 1; i < 4; i += 1) e += n.slice(i, i + 1).concat(n.slice(i, i + 1));
                            n = e;
                        }
                        var o = [];
                        for (i = 1; i < 7; i += 2) o.push(parseInt("0x" + n.slice(i, i + 2)));
                        return this.sumArr(o);
                    },
                    sumArr: function(t) {
                        return t.reduce(function(t, n) {
                            return t + n;
                        }, 0);
                    }
                }
            };
            n.default = s;
        }).call(this, e("543d").default);
    },
    5245: function(t, n, e) {
        (function(t) {
            e("f868"), i(e("66fd"));
            var n = i(e("7afb"));
            function i(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = e, t(n.default);
        }).call(this, e("543d").createPage);
    },
    "7afb": function(t, n, e) {
        e.r(n);
        var i = e("1749"), o = e("470c");
        for (var u in o) "default" !== u && function(t) {
            e.d(n, t, function() {
                return o[t];
            });
        }(u);
        e("fe49");
        var r = e("f0c5"), a = Object(r.a)(o.default, i.b, i.c, !1, null, "74224a21", null, !1, i.a, void 0);
        n.default = a.exports;
    },
    fe49: function(t, n, e) {
        var i = e("278d");
        e.n(i).a;
    }
}, [ [ "5245", "common/runtime", "common/vendor" ] ] ]);